package com.bdqn.t320.controller;

import com.bdqn.t320.pojo.SysUser;
import com.bdqn.t320.service.SysUserService;
import com.bdqn.t320.service.SysUserServiceImp;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Controller
public class UserController {

    //SysUserService sysUserService = new SysUserServiceImp();

    @Resource
    SysUserService sysUserService;

    @RequestMapping("/getuserlist")
    public String getUserList(Model model) {
        System.out.println("getUserList");
        List<SysUser> userList = sysUserService.getUserListBiz();
        model.addAttribute("userList",userList);
        return "userlist";
    }

    @RequestMapping("/findbyname")
    public String findbyname(Model model,String name) {
        System.out.println("findbyname" + name);
        model.addAttribute("name","姓名:" + name);
        return "findbyname";
    }
}
